<div class="container reg-page">
    <div class="col-md-12">	
    
        <div class="tab">
			<div class="tab-pane" data-click="true" id="login">
	            <a href="javascript:void(0);" class="pink">
				<i class="border-top"></i>
					已有账户
				</a>
			</div>
	        <div class="tab-pane gray" data-click="false" id="reg">
	             <a href="javascript:void(0);" class="gray">
	                <i class="border-top gray"></i>
				 	创建新帐号
				 </a>
			</div>
        </div>
        
        <div id="bind_login" class="tab-content" style="display:block">
        	<div class="bind_box">
        		<div class="top">
                    <span>如果您已经拥有1折网会员帐号，可以直接输入帐号密码进行关联！</span>
                </div>
                <div id="passportLogin" class="mid">
                    <div class="form">
                        <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            'id' => 'oauth-login-form',
                        ));
                        ?>
                        <?php echo $form->errorSummary($model); ?>
                        <div class="row icon user-group">
                            <i class="login-spt"></i>
                            <?php echo $form->textField($model, 'username', array('placeholder' => "请输入邮箱/用户名",'class'=>'input')); ?>                                  
                        </div>
                        <div class="row icon password-group">
                            <i class="login-spt"></i>
                            <?php echo $form->passwordField($model, 'password', array('placeholder' => "请输入密码",'class'=>'input'));?>
                        </div>
                        <input id="submit_type" class="input" type="hidden" name="submit_type" value="login">
                        <div class="buttons">
                            <?php echo CHtml::submitButton('确认绑定账号', array('class' => "submit")); ?>
                        </div>
                        
                        <?php $this->endWidget(); ?>

                    </div><!-- form -->
                </div>
                
        	</div>
		</div>
		
		<div id="bind_register" class="tab-content" style="display:none">
        	<div class="bind_box">
        		<div class="top">
                    <span>创建1折网会员帐号请完善以下用户信息！</span>
                </div>
                <div id="passportLogin" class="mid">
                    <div class="form">
                        <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            'id' => 'oauth-reg-form',
                        ));
                        ?>
                        <?php echo $form->errorSummary($model); ?>
                        <span class="lable">用户名：</span>
                        <div class="row icon user-group">
                            <i class="login-spt"></i>
                            <?php echo $form->textField($model, 'username', array('placeholder' => "请输入用户名",'class'=>'input')); ?>                                  
                        </div>
                        <span class="lable">邮箱：</span>
                        <div class="row icon user-group">
                            <i class="login-spt"></i>
                            <?php echo $form->textField($model, 'email', array('placeholder' => "请输入邮箱",'class'=>'input')); ?>                                  
                        </div>
                        <span class="lable">类型：</span>
                        <div class="row radios">
                        	<?php echo $form->radioButtonList($model, 'kind',array('1'=>'买家类型','0'=>'商家类型'),array('class'=>'radio'));?>
                        </div>
                        <span class="lable">密码：</span>
                        <div class="row icon password-group">
                            <i class="login-spt"></i>
                            <?php echo $form->passwordField($model, 'password', array('placeholder' => "请输入密码",'class'=>'input'));?>
                        </div>
                        <span class="lable">确认密码：</span>
                         <div class="row icon password-group">
                            <i class="login-spt"></i>
                            <?php echo $form->passwordField($model, 'repassword', array('placeholder' => "请重复密码",'class'=>'input'));?>
                        </div>
                        <input id="submit_type" class="input" type="hidden" name="submit_type" value="reg">
                        
                        <?php echo CHtml::submitButton('确认绑定账号', array('class' => "submit")); ?>
                        
                        <?php $this->endWidget(); ?>

                    </div><!-- form -->
                </div>
                
        	</div><!-- bind_box -->
        	
        </div><!-- bind_register -->
        
        <div class="clearfix"></div>
    </div>
</div>
<script>
$('#login').click(function(){

	var is_gray = $('#bind_login').css('display');
	var reg_a 	= $("#reg").find("a").first();
	var login_a = $("#login").find("a").first();
	var reg_i 	= $("#reg").find("i").first();
	var login_i = $("#login").find("i").first();

		$('#reg').attr("class",'tab-pane gray');
		$('#login').attr("class",'tab-pane ');
		reg_a.attr("class",'gray');
		login_a.attr("class",'pink');
		reg_i.attr("class",'border-top gray');
		login_i.attr("class",'border-top');
		$('#bind_login').css('display','block')
		$('#bind_register').css('display','none')
	
});

$('#reg').click(function(){

	var is_gray = $('#bind_login').css('display');
	var reg_a 	= $("#reg").find("a").first();
	var login_a = $("#login").find("a").first();
	var reg_i 	= $("#reg").find("i").first();
	var login_i = $("#login").find("i").first();
	
		$('#reg').attr("class",'tab-pane');
		$('#login').attr("class",'tab-pane gray');
		reg_a.attr("class",'pink');
		login_a.attr("class",'gray');
		reg_i.attr("class",'border-top');
		login_i.attr("class",'border-top gray');
		$('#bind_login').css('display','none')
		$('#bind_register').css('display','block')

});
</script>